﻿create or replace package PKG_STDPATTERN is

  -- Author  : HY
  -- Created : 2012-11-09 오후 1:07:54
  -- Purpose : 패턴코드 패키지 (추가, 수정, 삭제)

  -- Public function and procedure declarations
  procedure ADD_STDPATTERN (SECTION_IN IN NUMBER, NAME_IN IN VARCHAR2, CREATE_USER_IN NUMBER);
  procedure UPDATE_STDPATTERN (OBJECTID_IN IN NUMBER, SECTION_IN IN NUMBER, NAME_IN IN VARCHAR2, MODIFY_USER_IN IN NUMBER);
  procedure DELETE_STDPATTERN (OBJECTID_IN IN NUMBER, SECTION_IN IN NUMBER);
end PKG_STDPATTERN;







create or replace package body PKG_STDPATTERN as

  -- Function and procedure implementations
  -- 추가
  procedure ADD_STDPATTERN (SECTION_IN IN NUMBER, NAME_IN IN VARCHAR2, CREATE_USER_IN NUMBER) is
  begin
       INSERT INTO STDPATTERN (OBJECTID, SECTION, NAME, CREATE_USER)
       VALUES (SEQ_STDPATTERN.NEXTVAL, SECTION_IN, NAME_IN, CREATE_USER_IN);
  end ADD_STDPATTERN;

  -- 수정
  procedure UPDATE_STDPATTERN (OBJECTID_IN IN NUMBER, SECTION_IN IN NUMBER, NAME_IN IN VARCHAR2, MODIFY_USER_IN IN NUMBER) is
  begin
       UPDATE STDPATTERN A SET A.SECTION = SECTION_IN, A.NAME = NAME_IN, A.MODIFY_DATE = SYSDATE, A.MODIFY_USER = MODIFY_USER_IN WHERE A.OBJECTID = OBJECTID_IN;
  end UPDATE_STDPATTERN;

  -- 삭제
  procedure DELETE_STDPATTERN (OBJECTID_IN IN NUMBER, SECTION_IN IN NUMBER) is
  begin
       DELETE FROM STDPATTERN A WHERE A.OBJECTID = OBJECTID_IN AND A.SECTION = SECTION_IN;
  end DELETE_STDPATTERN;
end PKG_STDPATTERN;
